// pages/member/yhDetail/index.js
var t = getApp(), e = t.requirejs("core");

t.requirejs("foxui");

Page({

  /**
   * 页面的初始数据
   */
  data: {
    page: 1,
    loading: !1,
    loaded: !1,
    list: [],
    indexs:0
  },
  cwvip(e){
    wx.navigateTo({
      url: '/pages/member/recharge/recharge',
    })
  },
  levClick(e){
    console.log(e,78);
    var that =this;
    var index = e.currentTarget.dataset.index;
    var id = e.currentTarget.dataset.id
    that.setData({
      indexs:index
    })
    that.getgoodslist(id);
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var t = this;
    e.get("goods/poster/getcategory", {
    
    }, function (e) {
      console.log(e,222222)
      var list=e.result.data;
      t.setData({
        list: list
      })
      var cateid=list[0].id;

      t.getgoodslist(cateid);
  
  
     
    });
  },
 getgoodslist:function(id)
 {
   console.log(id,5555);
   var t = this;
   var id=id;
   e.get("goods/poster/get_list", {
     id:id,
     page: t.data.page
   }, function (e) {
      console.log(e,787878);
      t.setData({
        goodslist:e,
      })
     var i = {
       loading: !1,
       loaded: !0,
       total: e.total,
       pagesize: e.pagesize,
       show: !0
     };
    //  e.list.length > 0 && (i.page = t.data.page + 1, i.list = t.data.list.concat(e.list),
    //    e.list.length < e.pagesize && (i.loaded = !0)), t.setData(i);
   });
 },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})